<?php session_start();
if($_SESSION["id_cadastro_empresa"]==""){
header("Location: cadastro_empresa.php");
exit(); 
}

include "conexao.php";
header("Content-Type: text/html; charset=ISO-8859-1",true);

$ac = $_GET["ac"];
$id_vagas = $_GET["id_vagas"];

if($ac=="at"){
mysql_query("update vagas set ativo='S' where id_vagas = '$id_vagas' and id_cadastro_empresa = '".$_SESSION["id_cadastro_empresa"]."'");
}
if($ac=="des"){
mysql_query("update vagas set ativo='N' where id_vagas = '$id_vagas' and id_cadastro_empresa = '".$_SESSION["id_cadastro_empresa"]."'");
}
if($ac=="ex"){
mysql_query("delete from vagas where id_vagas = '$id_vagas' and id_cadastro_empresa = '".$_SESSION["id_cadastro_empresa"]."'");
}


?>
<div style="width:794px; height:100%; float:left; background-color: #FFFFFF;">
 <div style="width:794px; float:left; text-transform:capitalize; font-weight: bold; margin-bottom:20px; margin-top:10px; text-decoration:underline;" align="right">
 <a href="javascript:void(0)"  onclick="abrePesquisa('minhas_vagas.php','GET','conteudo');
         document.getElementById('altera').style.background='#ffffff';
       document.getElementById('altera_c').style.background='#000000';
        return false;
         ">Voltar a lista de vagas</a></div>
         <div style="width:794px; float:left; text-transform:capitalize; font-weight: bold; margin-bottom:20px; margin-top:10px; text-decoration:underline;" align="center">Lista de Candidatos</div>
         
        <div style="width:794px; float:left; text-transform:capitalize; font-weight: bold;">
          <div style="width:120px;float:left;border:1px solid #155E62;" align="center">cargo vaga</div>
        <div style="width:250px;float:left;border:1px solid #155E62;" align="center">Email Candidato</div>
        <div style="width:210px;float:left;border:1px solid #155E62;"  align="center">Nome do Candidato</div>
        <div style="width:110px;float:left;border:1px solid #155E62;" align="center">Cidade/uf</div>
        <div style="width:80px;float:left;border:1px solid #155E62;">A&ccedil;&otilde;es</div>
        </div>
        <div style="width:790px; height:100%; float:left;">
          <?php 
		  
		  $sq_v = mysql_query("SELECT vagas.cargo_vaga, c. * , cr. * , vagas_curriculos.id_curriculos
FROM vagas, cadastro_usuarios c, curriculos cr, vagas_curriculos
WHERE vagas.id_vagas=vagas_curriculos.id_vagas and cr.id_curriculos = vagas_curriculos.id_curriculos
AND c.id_cadastro_usuarios = cr.id_cadastro_usuarios
AND vagas_curriculos.id_vagas = '$id_vagas'");
		  
		  
		        while($linha=mysql_fetch_array($sq_v)){
			   extract($linha);
		  ?>
        
        
        <div style="width:120px; height:45px;float:left; border:1px solid #CCCCCC;"><div style="margin-top:10px; margin-left:5px;"><?php echo $cargo_vaga; ?></div></div>
        <div style="width:250px;height:45px;;float:left;border:1px solid #CCCCCC;"><div style="margin-top:10px; margin-left:5px;"><?php echo $email ; ?></div></div>
        <div style="width:210px;height:45px;float:left;border:1px solid #CCCCCC;"><div style="margin-top:10px; margin-left:5px;">
		<?php $non=explode(" ",$nome); echo $non[0]." ".$non[1];?></div></div>
        <div style="width:110px;height:45px;float:left;border:1px solid #CCCCCC;"><div style="margin-top:3px; margin-left:5px;"><?php echo $txt_id_cidade."<Br>/".$txt_id_estado; ?></div></div>
        <div style="width:80px;height:45px;float:left;border:1px solid #CCCCCC;">
        <a href="visualizar_curriculo.php?id_cadastro_usuarios=<?php echo $id_cadastro_usuarios;?>&id_curriculos=<?php echo $id_curriculos ?>" onclick="return GB_myShow('Visualiza&ccedil;&atilde;o do Curriculo', this.href)">Visualizar</a>
        </div>
         <?php }?>
         
  </div>
</div>
        
        
        
        
        